using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace SmartIot.Models.SolarTerms
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [BindTable("TermsArticle", Description = "", ConnName = "ConnName_SolarTerms", DbType = DatabaseType.MySql)]
    public partial class TermsArticle : ITermsarticle
    {
        #region 属性
        private Int32 _ID;
        /// <summary></summary>
        [DisplayName("ID")]
        [DataObjectField(true, true, false, 0)]
        [BindColumn("ID", "", "int(11)")]
        public Int32 ID { get { return _ID; } set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } } }

        private Int32 _TermsID;
        /// <summary></summary>
        [DisplayName("TermsID")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("TermsID", "", "int(11)")]
        public Int32 TermsID { get { return _TermsID; } set { if (OnPropertyChanging(__.TermsID, value)) { _TermsID = value; OnPropertyChanged(__.TermsID); } } }

        private Int32 _CategoryID;
        /// <summary></summary>
        [DisplayName("CategoryID")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("CategoryID", "", "int(11)")]
        public Int32 CategoryID { get { return _CategoryID; } set { if (OnPropertyChanging(__.CategoryID, value)) { _CategoryID = value; OnPropertyChanged(__.CategoryID); } } }

        private DateTime _CreateTime;
        /// <summary></summary>
        [DisplayName("CreateTime")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("CreateTime", "", "datetime")]
        public DateTime CreateTime { get { return _CreateTime; } set { if (OnPropertyChanging(__.CreateTime, value)) { _CreateTime = value; OnPropertyChanged(__.CreateTime); } } }

        private String _Title;
        /// <summary></summary>
        [DisplayName("Title")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn("Title", "", "varchar(255)", Master = true)]
        public String Title { get { return _Title; } set { if (OnPropertyChanging(__.Title, value)) { _Title = value; OnPropertyChanged(__.Title); } } }

        private String _Content;
        /// <summary></summary>
        [DisplayName("Content")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("Content", "", "mediumtext")]
        public String Content { get { return _Content; } set { if (OnPropertyChanging(__.Content, value)) { _Content = value; OnPropertyChanged(__.Content); } } }

        private String _Remark;
        /// <summary></summary>
        [DisplayName("Remark")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn("Remark", "", "varchar(255)")]
        public String Remark { get { return _Remark; } set { if (OnPropertyChanging(__.Remark, value)) { _Remark = value; OnPropertyChanged(__.Remark); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.ID : return _ID;
                    case __.TermsID : return _TermsID;
                    case __.CategoryID : return _CategoryID;
                    case __.CreateTime : return _CreateTime;
                    case __.Title : return _Title;
                    case __.Content : return _Content;
                    case __.Remark : return _Remark;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.ID : _ID = Convert.ToInt32(value); break;
                    case __.TermsID : _TermsID = Convert.ToInt32(value); break;
                    case __.CategoryID : _CategoryID = Convert.ToInt32(value); break;
                    case __.CreateTime : _CreateTime = Convert.ToDateTime(value); break;
                    case __.Title : _Title = Convert.ToString(value); break;
                    case __.Content : _Content = Convert.ToString(value); break;
                    case __.Remark : _Remark = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得Termsarticle字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary></summary>
            public static readonly Field ID = FindByName(__.ID);

            /// <summary></summary>
            public static readonly Field TermsID = FindByName(__.TermsID);

            /// <summary></summary>
            public static readonly Field CategoryID = FindByName(__.CategoryID);

            /// <summary></summary>
            public static readonly Field CreateTime = FindByName(__.CreateTime);

            /// <summary></summary>
            public static readonly Field Title = FindByName(__.Title);

            /// <summary></summary>
            public static readonly Field Content = FindByName(__.Content);

            /// <summary></summary>
            public static readonly Field Remark = FindByName(__.Remark);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得Termsarticle字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary></summary>
            public const String ID = "ID";

            /// <summary></summary>
            public const String TermsID = "TermsID";

            /// <summary></summary>
            public const String CategoryID = "CategoryID";

            /// <summary></summary>
            public const String CreateTime = "CreateTime";

            /// <summary></summary>
            public const String Title = "Title";

            /// <summary></summary>
            public const String Content = "Content";

            /// <summary></summary>
            public const String Remark = "Remark";
        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface ITermsarticle
    {
        #region 属性
        /// <summary></summary>
        Int32 ID { get; set; }

        /// <summary></summary>
        Int32 TermsID { get; set; }

        /// <summary></summary>
        Int32 CategoryID { get; set; }

        /// <summary></summary>
        DateTime CreateTime { get; set; }

        /// <summary></summary>
        String Title { get; set; }

        /// <summary></summary>
        String Content { get; set; }

        /// <summary></summary>
        String Remark { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}